﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="listnews.ascx.cs" Inherits="controls_admin_listnews" %>
<div id="content">   
	    <div class="box corners shadow">
            <div class="box-header">
                <h2>Danh sách bài viết</h2>
                <div class="box-header-ctrls">	
            	    <a href="javascript:void(null);" title="" class="close"><!-- --></a>
                </div>
            </div>            
            <div class="box-content" id="articles-2">
                <div class="inbox-sf">
                   <asp:TextBox ID="search" runat="server" onFocus="if(this.value=='Tìm bài viết')this.value='';" onBlur="if(this.value=='')this.value='Tìm bài viết';" Text="Tìm bài viết" CssClass="input-1"></asp:TextBox>                   
                   <asp:DropDownList ID="cate" runat="server" CssClass="select-1"></asp:DropDownList>
                   <asp:Button ID="btnSearch" runat="server" Text="Tìm" CssClass="inbox-sf-search-btn" />
                   <asp:Button ID="btnAdd" runat="server" Text="Thêm bài viết" CssClass="inbox-sf-add-btn tip" />                    
                </div>
                <ul class="articles-list-2">
                    <asp:GridView ID="gvNews" runat="server" AutoGenerateColumns="False" 
                        DataSourceID="dsnews" onrowcommand="gvNews_RowCommand" Width="100%">
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <li class="art" style="height:200px">
                                        <div class="articles-left">
                    	                    <h2>
                                                <asp:HyperLink ID="title" runat="server" 
                                                    NavigateUrl='<%# "~/detailnews.aspx?key="+Eval("Id") %>' 
                                                    Text='<%# Eval("TieuDe") %>'></asp:HyperLink>
                                            </h2>
                                            <p>                                        
                                                <asp:Image ID="pic" runat="server" Width="170px" Height="110px" 
                                                    ImageUrl='<%# "~/images/news/content/" + Eval("HinhAnh") %>' />
                                                <asp:Label ID="summary" runat="server" Text='<%# Eval("TomTat") %>'></asp:Label>
                                            </p>
                                        </div>
                                        <ul class="articles-right">
                                            <li>
                                                <b>Chuyên mục: </b> 
                                                <asp:Label ID="cate" runat="server" Text='<%# Eval("TenChuyenMuc") %>'></asp:Label>
                                            </li>
                    	                    <li>
                    	                        <b>Ngày đăng:</b>
                    	                        <asp:Label ID="date" runat="server" Text='<%# Eval("NgayDang", "{0:dd/MM/yyyy}") %>'></asp:Label>                    	            
                    	                    </li>
                                            <li>
                                                <b>Người viết:</b> 
                                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("TenDangNhap") %>'></asp:Label>
                                            </li>
                                            <li>
                                                <b>Trạng thái:</b> 
                                                <asp:CheckBox ID="status" runat="server" Checked='<%# Eval("TrangThai") %>' 
                                                    Text="Đã được đăng" />
                                            </li>
                                            <br />
                                            <asp:ImageButton ID="editpost" runat="server" ImageUrl="~/images/button/b_edit_post.png" CommandName="editpost" 
                                                    PostBackUrl='<%# "~/admin/editpost.aspx?key="+Eval("Id") %>' />
                                            &nbsp;
                                            <asp:ImageButton ID="deletepost" runat="server" ImageUrl="~/images/button/b_delete_post.png" CommandName="delpost" />                                   
                                            &nbsp;<asp:HyperLink ID="HyperLink1" runat="server" 
                                                NavigateUrl='<%# "~/admin/editpost.aspx?key="+Eval("Id") %>'>Sửa</asp:HyperLink>
                                        </ul>
                                    </li>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>                        
                    </asp:GridView>
                </ul>
                <div class="box-bt-bar">
                    <ul class="box-nav">
                        <li><a href="#" title="" class="prev">Sau</a></li>
                        <li><a href="#" title="" class="active">1</a></li>
                        <li><a href="#" title="" class="num">2</a></li>
                        <li><a href="#" title="" class="num">3</a></li>
                        <li><a href="#" title="" class="num">4</a></li>
                        <li><a href="#" title="" class="num">..</a></li>
                        <li><a href="#" title="" class="next">Trước</a></li>
                    </ul>
                    <div class="bulk-actions">
                       <select name="field-13" class="select-1">
                            <option value="">Chọn thao tác</option>
                            <option value="">Sửa</option>
                            <option value="">Xóa</option>
                        </select>
                        <input type="reset" value="Làm mới" />
                        <input type="submit" value="Áp dụng" />
                    </div> 
                </div>                                       
            </div>
        </div> 
</div>
<asp:SqlDataSource ID="dsnews" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
    SelectCommand="AdminNewsList" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
